package com.seagull.core.http.controller.req;

import com.commons.plugins.validation.AtLeastOneNotNull;
import com.commons.plugins.validation.base.Query;
import com.commons.plugins.validation.base.Update;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

@AtLeastOneNotNull(groups = Query.class,fieldNames = {"uid", "phone"})
public class ReqUser implements Serializable {

    @NotNull(message = "uid不能为空")
    private Integer uid ;

    @NotNull(groups = Update.class)
    private String name;

    @NotEmpty(message = "phone不能为空")
    private String phone;

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public String toString() {
        return "ReqUser{" +
                "uid=" + uid +
                ", name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                '}';
    }
}
